<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <script type="text/javascript"/>
    <h:head >
    </h:head>
    <body>
        <ui:composition template="./../noLogin/myTemplate2.xhtml">
            <ui:define name="content"> 
                <h:messages  style="color: red" id="latestMessage"/>
                <div class="companyInfo">
                    <h:form id="myForm">
                        <h:messages  style="color: red" id="latestMessage"/>
                        <h:panelGrid columns="3" >
                            <h:outputLabel value="#{msgs.selectSchool}"/>
                                <h:selectOneMenu value="#{nameofUnitBean.schoolId}" id="myschoolId" required="true" >
                                    <f:selectItem itemLabel="#{msgs.selectSchool}" itemValue="null" />
                                    <f:selectItems value="#{nameofUnitBean.schoolMap}"/>
                                    <f:ajax render="mysclassId"/>
                                </h:selectOneMenu>
                                <h:commandButton action="#{userinfoBean.direct2BackupImport()}" value="#{msgs.batchImport}#{msgs.sutInfoList}"/>
                            <h:outputLabel value="#{msgs.selectclass}"/>
                            <h:selectOneMenu value="#{nameofUnitBean.classId}" id="mysclassId" validator="#{userinfoBean.assingValue2Classid}" >
                                <f:selectItem itemLabel="#{msgs.selectclass}" itemValue="null" />
                                <f:selectItems value="#{nameofUnitBean.classNameMap}"/>
                                <f:ajax render="stu"/>
                            </h:selectOneMenu>
                        </h:panelGrid>

                        <h1><h:outputText value="学生信息列表"></h:outputText></h1>
                        <h:dataTable id ="stu" value="#{userinfoBean.student}" var="ci"
                                     border="1" styleClass="tableClass" headerClass="tableHeaderClass" 
                                     columnClasses="firstColumn,secondColum,thirdColumn,fourthColum，fifthColum  " 
                                     >
                            <h:column> 
                                <f:facet name="header">#{msgs.name}</f:facet>
                                <h:outputText value="#{ci.name}"/>  
                            </h:column>  
                            <h:column> 
                                <f:facet name="header">#{msgs.userno}</f:facet>
                                <h:outputText value="#{ci.uno}"/>  
                            </h:column>
                            <h:column> 
                                <f:facet name="header">#{msgs.unitNamein}</f:facet>
                                <h:selectOneMenu value="#{ci.nameofunitid}">
                                    <f:selectItem itemLabel="#{ci.nameofunit.name}" itemValue="#{ci.nameofunitid}"/>
                                    <f:selectItems value="#{nameofUnitBean.classNameMap}"/>
                                </h:selectOneMenu>
                            </h:column>
                            <h:column>
                                <f:facet name="header">#{msgs.alter}</f:facet>
                                <h:commandButton value="#{msgs.alter}" action="#{userinfoBean.save(ci.uno,ci.nameofunitid)}"/>
                            </h:column> 
                            <h:column>
                                <f:facet name="header">#{msgs.delete}</f:facet>
                                <h:commandButton value="#{msgs.delete}" action="#{userinfoBean.deleteRow(ci)}"/>
                            </h:column>

                        </h:dataTable>
                    </h:form>
                </div>
            </ui:define>
        </ui:composition>
    </body>
</html>
